<{capture name="header"}>
  	   <style> 
			.tabs-wrap ul{margin-left:100px;}
			textarea{border:none;font-family:Verdana;font-size:12px;color:#336600;}
	   </style>
<{/capture}>
<form id="idForm" method='post' action='index.php?app=b2c&ctl=admin_order&act=savePrintStyle' style="text-align:center;position:relative">
	<div class="notice" style="position:absolute;bottom:0;left:0">
		<div class="clearfix">
		  <div class="span-auto">订单打印样式的html代码无需加入 html、head、body等html标签。 </div>
		  <div class="frt"><span class="font-red" onclick="$(this).getParent('.notice').dispose()">[X]</span></div>
		</div>
	</div>
<{tabber}>
  <{tab name=$___b2c="购物清单"|t:'b2c'}>
<{input type="textarea" name="txtcontentcart" class="info-text" style="height:100%;width:100%" value=$styleContentCart }>

  <{/tab}>
  <{tab name=$___b2c="配货单"|t:'b2c' }>
<{input type="textarea" name="txtcontentsheet" class="info-text" style="height:100%;width:100%" value=$styleContentSheet }>
  <{/tab}>

  <{tab name=$___b2c="旧版订单打印单"|t:'b2c' }>
<{input type="textarea" name="txtcontent" class="info-text" style="height:100%;width:100%" value=$styleContent }>
  <{/tab}>
<{/tabber}>


</form>
<{capture name="footbar"}>
<div class="table-action">
	<{button label=$___b2c="保存"|t:'b2c' type="button" id="idsave"}>
	<{button label=$___b2c="恢复初始样式"|t:'b2c' type="button" class="btn btn-secondary" id="idresume"}>
	<{button label=$___b2c="关闭"|t:'b2c' class="btn btn-secondary" type="button" onclick="opener=null;window.close();"}>    
</div> 
<{/capture}>
<script>                     
window.addEvent('resize',function(){

	var h = $('main').getSize().y-85;
	if(isNaN(h)||h<0){
		h=200;
	}
	
    $$('#idForm textarea').setStyles({
		'height':h,
		'width':'95%'
		
	}) 
	
}).fireEvent('resize');
 
  $('idresume').addEvent('click',function(e){
	if (confirm('<{t}>恢复后将覆盖现有样式，确定要恢复吗？<{/t}>')){ 
    
new Request.JSON({url:'index.php?app=b2c&ctl=admin_order&act=rebackPrintStyle',onComplete:function(re){
		 
		if('success' in re){
			alert(re.success);
			window.location.href=window.location.href;
		}else{
		    MessageBox.error(re.error); 
		}       
		
	}}).post($('idForm'));
	   
	}
    
  });

$('idsave').addEvent('click',function(){
	    $('idForm').fireEvent('submit',{stop:$empty});
	
});
</script>